package xinxin.com.ChainofResponsibilityPattern.Manager;

import xinxin.com.ChainofResponsibilityPattern.Request.Request;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/4/1 20:31
 */
// 经理
public class CommonManager extends Manager {
    public CommonManager(String name) {
        super(name);
    }

    @Override
    public void RequestApplicatuions(Request request) {
        if (request.getRequestType().equals("请假") && request.getNumber() <= 2) {
            System.out.println(name + ":" + request.getRequestContent() + " 数量" + request.getNumber() + " 被批准");
        } else if (superior != null) {
            superior.RequestApplicatuions(request);
        }
    }
}
